package nl.samenloop.bigscreen;

import java.awt.Color;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class Constants {

	public static Color PURPLE = new Color(78, 30, 138);
	public static Color TRANSPARANT = new Color(255, 255, 255, 0);
	
	public final static String CLOCK_TITLE = "clock.title";
	public final static String CLOCK_URL = "clock.url";
	
	public final static String NEXT_STAGE = "program.next_stage.title";
	public final static String NOW_STAGE = "program.now_stage.title";
	
	public final static String NEXT_FIELD = "program.next_field.title";
	public final static String NOW_FIELD = "program.now_field_title";
	
	public final static String TWITTER = "twitter.title";
	public final static String TWITTER_TIME = "twitter.display_time";
	public final static String TIMELINE_URL = "twitter.timeline_url"; 
	
	public final static String WEATHER = "weather.title";
	public final static String WEATHER_TIME = "weather.display_time";
	
	public final static String TITLE_FADE = "title.fade_time";
	public final static String PANEL_FADE = "panel.fade_time";
	
	public final static String PROGRAM_TIME = "program.display_time";
		
	public static Properties properties;
	
	public final static String LOCATION = "weather.location";
	public final static String STAGE_URL = "program.stage_url";
	public final static String FIELD_URL = "program.field_url";
	
	public static String getProperty(String propertyName){
		if (properties == null) {
			properties = new Properties();
			try {
				properties.load(new BufferedReader(new FileReader("res/settings.properties")));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
		if (properties.containsKey(propertyName)) {
			return (String) properties.get(propertyName);
		} else {
			return "";
		}
		
	}
	
}
